# 学习requests模块基础----get()

import requests

keySearch=input("输入一个你喜欢的明星:")
url = f'https://www.sogou.com/web?query={keySearch}'
dic = {
    "user-agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
}
resp = requests.get(url, headers=dic)


print(resp)

with open("202208251019_spiderBaidu.txt",mode="w",encoding="utf-8") as f:
    f.write(resp.text)
print("over!")